using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;
using OpenComposite.Repository.Properties;

namespace OpenComposite.EII.Forms
{
	public partial class FormBObjectViewer : Form
	{
		public FormBObjectViewer()
		{
			InitializeComponent();

			xmlEditor.SetHighlighting("XML");
		}

		private Repository.BusinessObject _bobject = null;
		public Repository.BusinessObject BusinessObject
		{
			get { return _bobject; }
			set
			{
				_bobject = value;
				tvBObject.BusinessObject = _bobject;
				tvBObject.ExpandAll();
				if ( _bobject != null ) {
					this.Text = "Business Object: " + _bobject.Name;
					xmlEditor.Text = Helpers.FormatXmlString(_bobject.SchemaString);
				} else {
					this.Text = "Business Object Viewer";
					xmlEditor.Text = "";
				}
			}
		}
		private void formXmlViewer_FormClosing(object sender, FormClosingEventArgs e)
		{
		}
	}
}
